package georah.map.tools
{

	import georah.map.MapMouseEvent;

	/**
	 *
	 * @author yuanm
	 */
	public final class MouseQuery extends PointQuery
	{
		override public final function get keyboardLocked():Boolean
		{
			return false;
		}

		override public final function get mouseLocked():Boolean
		{
			return true;
		}

		override protected final function this_disableHandler(event:MapToolEvent):void
		{
			map.removeEventListener(MapMouseEvent.CLICK, map_clickHandler);

			super.this_disableHandler(event);
		}

		override protected final function this_enableHandler(event:MapToolEvent):void
		{
			super.this_enableHandler(event);

			map.addEventListener(MapMouseEvent.CLICK, map_clickHandler);
		}

		private final function map_clickHandler(event:MapMouseEvent):void
		{
			identify(event.pixel);
		}

	}
}
